Skip to content

Make Slider UI elements larger when widget size increases#3855

Open
georgweiss wants to merge 2 commits into
masterfrom
CSSTUDIO-1723
Open

Make Slider UI elements larger when widget size increases#3855
georgweiss wants to merge 2 commits into
masterfrom
CSSTUDIO-1723

Conversation

@georgweiss

Copy link
Copy Markdown
Collaborator

Supersedes #3854 to deal with code formatting and readability.

  • Testing:

    • The feature has automated tests
    • [ X] Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

@georgweiss georgweiss requested review from jacomago and shroffk June 28, 2026 09:06
*/
private void adjustSizes(){
SliderSkin skin = (SliderSkin) slider.getSkin();
if (skin != null) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you return for skin == null you avoid the heavy nesting.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Heavy" is maybe not how I would describe it, but I'll update.

for (Node node : skin.getChildren()) {
if (node.getStyleClass().contains("thumb")) {
// 7.6 seems to be default padding
node.setStyle("-fx-padding: " + Math.clamp(size * 0.3, 7.6, 20));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define all these numbers as constants with descriptive names?

Then you don't really need the comments

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point

@sonarqubecloud

sonarqubecloud Bot commented Jul 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants